feat(cuda): export FSST directly to Arrow varbin - #8787
Conversation
Benchmarks: Vortex queriesVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.056x ➖, 0↑ 0↓)
datafusion / parquet (1.005x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.009x ➖, 0↑ 0↓)
duckdb / parquet (0.998x ➖, 0↑ 0↓)
No file size changes detected. |
Merging this PR will improve performance by 51.12%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | cuda/bitpacked_u8/unpack/3bw[100M] |
646.3 µs | 300.3 µs | ×2.2 |
| ⚡ | WallTime | cuda/bitpacked_patched_u8/unpack/1%[100M] |
768.9 µs | 381.8 µs | ×2 |
| ⚡ | WallTime | cuda/bitpacked_patched_u8/unpack/10%[100M] |
828.6 µs | 477.3 µs | +73.58% |
| ⚡ | WallTime | cuda/bitpacked_patched_u16/unpack/1%[100M] |
712.3 µs | 595.4 µs | +19.64% |
| ⚡ | WallTime | cuda/bitpacked_patched_u16/unpack/10%[100M] |
831 µs | 714.1 µs | +16.36% |
| ⚡ | WallTime | cuda/bitpacked_u16/unpack/5bw[100M] |
634.8 µs | 558.1 µs | +13.73% |
| 🆕 | WallTime | cuda/fsst/decompress_to_varbin[10M] |
N/A | 19.3 ms | N/A |
| 🆕 | WallTime | cuda/fsst/decompress_to_varbinview[10M] |
N/A | 19.9 ms | N/A |
| 🆕 | WallTime | cuda/fsst/export_binary_view[10M] |
N/A | 20.1 ms | N/A |
| 🆕 | WallTime | cuda/fsst/export_binary[10M] |
N/A | 19.4 ms | N/A |
| 🆕 | WallTime | cuda/fsst/export_utf8_view[10M] |
N/A | 20 ms | N/A |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ad/cuda-fsst-varbin-export (2cc117e) with develop (54b045b)
Footnotes
-
10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
|
@claude review |
|
Claude finished @0ax1's task in 3m 38s —— View job Claude PR ReviewReviewed the full diff against 🔴 Correctness / behavior
🟡 Kernel / soundness
🟢
|
|
I think the PR description is now stale, still refers to the fallback for >2G arrays |
Decode FSST directly into device-resident Arrow offsets and values while retaining opt-in VarBinView export. Add session-level layout selection, coverage for both layouts, and CUDA benchmarks. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
arrow_device_export_field patched Utf8/Binary only at the top level of a dtype and recursed into structs, but List fell through to the plain to_arrow_field mapping. With the offset-based default layout, a schema derived from the dtype alone (e.g. for a chunked list of strings) declared Utf8View elements while the data was exported as 3-buffer Utf8, so consumers read offsets as views. Rebuild list element fields recursively like struct fields. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
…range Under the offset-based default layout, an FSST array whose decoded size exceeds i32::MAX failed to export, while the previous Utf8View default handled such heaps via the multi-buffer host rollover. Route oversized arrays to the view layout instead: the schema derivation and the data export share fsst_varbin_offsets_fit, so a given array always resolves to the same layout. Verified end-to-end with a fabricated 2.1 GiB decode on a GH200: the export produces a Utf8View schema with views, two rolled-over data buffers, and variadic sizes. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
…sertion Assert the varbin output base is 16-byte aligned like the view decode path does, since both share Scratch::drain's alignment-gated stores. Also refresh the stale kernel comment about output offset widths and note that the offset-based FSST export bypasses CudaDispatchMode. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
…ying bytes BitBuffer::sliced documents that it returns a buffer with offset reset to zero, but the non-byte-aligned branch used bitwise_unary_op_copy, which preserves the source offset. Consumers that hand the raw bytes to FFI or device code indexing from bit zero (the CUDA FSST decoders) read validity shifted by the slice offset, decoding null slots and skipping valid ones. Copy through BitBufferMut::append_buffer, which performs the unaligned shift into an offset-0 buffer. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
…nesting Exercise the direct FSST-to-Arrow-varbin path with full content assertions (offsets, values, null bitmap) across partial-null, all-null, all-empty, empty, and sliced arrays, plus FSST nested as a struct field and as dictionary values. The sliced case caught the BitBuffer::sliced offset bug fixed in the previous commit: the decoded batch dropped 'delta' and decoded a null slot instead. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Realign unaligned sliced buffers through padded logical words instead of bitvec unaligned copying, preserving the documented offset-zero result without violating Stacked Borrows. Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
Signed-off-by: Alexander Droste <alexander.droste@protonmail.com>
90a8c08 to
2cc117e
Compare
onursatici
left a comment
There was a problem hiding this comment.
currently we only support the varbin export to arrow, and don't go from a vortex varbin array, but I think that is fine for now
Polar Signals Profiling ResultsLatest Run
Powered by Polar Signals Cloud |
Summary
Decode CUDA FSST arrays directly into Arrow’s standard offset-based
Utf8/Binarylayout:i32offsets plus one contiguous device values buffer.Previously, FSST decoded to
Utf8View/BinaryView. Since cuDF does not consume view arrays, it then had to materialize the same offset-based representation itself. Direct varbin export avoids that additional conversion and enables BenchPress GPU reads for Vortex string columns.Behavior changes
CUDA sessions now default variable-length exports to standard Arrow
Utf8/Binary.Consumers that support views can opt in with: